import Vue from 'vue';
import App from './App';
import store from './store';
import api from '@/common/js/api/';
import common from '@/common/js/common';
import config from '@/common/js/config';
import filters from '@/common/js/filter.js';
import user from '@/common/js/user.js';
import up from '@/common/js/up.js';
import dateUitl from '@/common/js/dateUitl.js';
import regular from '@/common/js/regular.js';
import list from '@/common/js/list.js';
import load from '@/components/base/load';
import listTips from '@/components/base/list_tips';
import publics from '@/components/base/public';


// 引入全局uView
import uView from 'uview-ui'
Vue.use(uView);
Vue.config.productionTip = false
App.mpType = 'app';
Vue.prototype.$store = store; //引入vuex
Vue.prototype.$config = config;
Vue.prototype.$api = api;
Vue.prototype.$common = common;
Vue.prototype.$user = user;
Vue.prototype.$regular = regular;
Vue.prototype.$up = up;
Vue.prototype.$list = list;
Vue.prototype.$dateUitl = dateUitl;

Vue.prototype.$message = {
	error(text){
		uni.showToast({
			title:text,
			icon:'none',
			duration:config.timeLoad,
			mask: true,
		})
	},
	success(text){
		uni.showToast({
			title:text,
			icon:'success',
			duration:config.timeLoad,
			mask: true,
		})
	}
}


//全局过滤器
Object.keys(filters).forEach(key=>{
    Vue.filter(key,filters[key])
})
//自定义组件
Vue.component('public', publics);
Vue.component('listTip', listTips);
Vue.component('load', load);
const app = new Vue({
    ...App
})
app.$mount()
